const source = require("./source");
const app = require("../extend/application.js");
const random = require("../service/get/random.js");
// const address = require("../public/address.js");

module.exports = [{
    name: "admin",
    text: "管理员",
    total: 10,
    // total: 10,
    produce: "",
    fields: ["tel", "psd", "name", "sex", "nickname", "type", "identity"],
    foreigns: []
}, {
    name: "user",
    text: "用户",
    total: 1000,
    // total: 10,
    produce: "",
    fields: ["tel", "psd", "avatar", "nickname", "name", "birthday", "sex", "inTime", "outTime", "lastTime", "coin", "status"],
    foreigns: []
}, {
    name: "courier",
    text: "快递员",
    total: app.countyTotal * 2,
    // total: app.countyTotal,
    produce: "",
    fields: ["provinceId", "cityId", "countyId", "detailAddress", "tel", "name"],
    foreigns: []
}, {
    name: "voucher",
    text: "优惠券",
    total: 30,   //不低于10
    // total: 10,
    produce: "",
    fields: ["useCase", "faceVal", "startTime", "endTime", "amount", "theme"],
    foreigns: [{
        name: "voucher_log",
        text: "优惠券日志",
        total: `[50,100]`,    //根据用户的活跃数量决定
        // total: "[5,10]",
        produce: "",
        fields: ["userId", "voucherId", "getTime"],
        foreigns: []
    }]
}, {
    name: "subbranch",
    text: "分店",
    total: app.provinceTotal * 2,
    // total: app.provinceTotal,
    produce: "",
    fields: ["provinceId", "cityId", "countyId", "detailAddress", "managerTel", "managerName"],
    foreigns: []
}, {
    name: "goods",
    text: "商品",
    total: app.goodsTotal,
    // total: 10,
    produce: "",
    fields: ["marketTime", "cameraFront", "cameraBehind", "showResolution", "showSize", "networkType", "networkMode", "baseName", "baseBrand", "baseSeries", "baseBattery", "baseCpuCores", "baseCpuBrand", "imgs", "title", "status"],
    foreigns: [{
        name: "goods_style",
        text: "商品款式",
        total: "[5,10]",  //最大值不要超过12   ramsLen(2)*romsLen(2)*colorsLen(3)=12
        // total: "[5,10]",  //最大值不要超过12   ramsLen(2)*romsLen(2)*colorsLen(3)=12
        produce: "",
        fields: ["goodsId", "ram", "rom", "color", "colorImg", "price", "inventory"],
        foreigns: []
    }]
}, {
    name: "station",
    text: "物流站点",
    total: app.cityTotal + app.countyTotal * 2,  //0普通快递 1物流分拣中心
    // total: app.cityTotal + app.countyTotal * 2,  //0普通快递 1物流分拣中心
    produce: "",
    fields: ["provinceId", "cityId", "countyId", "suffixName", "detailAddress", "level"],
    foreigns: []
}, {
    name: "getGoodsInfo",
    text: "收货信息",
    total: 1000,
    // total: 10,
    produce: "",
    fields: ["userId", "userName", "userTel", "provinceId", "cityId", "countyId", "detail", "editTime"],
    foreigns: []
}, {
    name: "deal",
    text: "交易",
    total: 5000,
    // total: 10,
    produce: "",
    fields: ["userId", "status", "startTime", "endTime", "voucherLogIds", "note", "getGoodsInfoId"],
    foreigns: [{
        name: "deal_list",
        text: "交易清单",
        total: "50,1;30,2;10,3;10,4-5",   //[[50,[1]],[30,[2]],[10,[3]],[10,[4,5]]]
        // total: "50,1;30,2;10,3;10,4-5",   //[[50,[1]],[30,[2]],[10,[3]],[10,[4,5]]]
        produce: "",
        fields: ["dealId", "goodsId", "color", "ram", "rom", "setMeal", "amount", "unitPrice"],
        foreigns: []
    }, {
        name: "transfer",
        text: "物流中转信息",
        total: "10,2-3;20,4-5;70,6-7-8-9-10",   //total>=2
        // total: "10,2-3;20,4-5;70,6-7-8-9-10",   //total>=2
        produce: "",
        fields: ["dealId", "stationId", "arriveTime"],
        foreigns: []
    }]
}, {
    name: "comment",
    text: "评价",
    total: 1000,
    // total: 10,
    produce: "",
    fields: ["dealListId", "type", "stars", "content", "imgs", "time", "readAmount"],
    foreigns: []
}, {
    name: "shopCart",
    text: "购物车",
    total: 1000,
    // total: 10,
    produce: "",
    fields: ["goodsStyleId", "userId", "amount", "setMeal", "time"],
    foreigns: []
}, {
    name: "manageLog",
    text: "管理日志",
    total: 100,
    // total: 10,
    produce: "",
    fields: ["operateObj", "operaterId", "operateType", "operatedId", "time"],
    foreigns: []
}]

